﻿#ifndef BPERRTP_BPERWEBSOCKET_H_
#define BPERRTP_BPERWEBSOCKET_H_
#include <bperutil/BPerType.h>
#include <bperutil/BPerAvType.h>
#include <bperutil/sys/BPerUrl.h>


typedef struct BPerWebsocketData{
	uint8_t payload[1024];
	int nb;
}BPerWebsocketData;

typedef struct BPerWebsocketCallback{
	void* context;
	int (*receive)(void* context,BPerSample* data);
}BPerWebsocketCallback;

typedef struct{
	void* context;
	int32_t (*connectServer)(void* context,char* url);
	int32_t (*disconnectServer)(void* context);
	int32_t (*sendData)(void* context,uint8_t* p,int nb);
}BPerWebsocket;
#ifdef __cplusplus
extern "C"{
#endif
void bPer_create_websocket(BPerIpFamilyType familyType1,BPerWebsocket* web,BPerWebsocketCallback* callback);
void bPer_destroy_websocket(BPerWebsocket* web);
#ifdef __cplusplus
}
#endif

#endif /* BPERRTP_BPERWEBSOCKET_H_ */
